package main

import "fmt"

// func selectSrot(inList []int) (outList []int) {
// 	var flagIndex int
// 	listLength := len(inList)
// 	for index := range inList {
// 		flagIndex = index
// 		for i := index; i < listLength; i++ {
// 			if inList[i] < inList[flagIndex] {
// 				flagIndex = i
// 			}
// 		}
// 		if index != flagIndex {
// 			inList[index], inList[flagIndex] = inList[flagIndex], inList[index]
// 		}

// 	}
// 	fmt.Println(inList)
// 	return inList
// }

func selectSort(inList []int) {
	listLength := len(inList)
	for j := 0; j < listLength; j++ {
		for i := j + 1; i < listLength; i++ {
			if inList[i] < inList[j] {
				inList[i], inList[j] = inList[j], inList[i]
			}
			fmt.Println(inList[i])
		}
	}
	fmt.Println(inList)

}

func main() {
	inList := []int{4, 21, 567, 12, 67, 1, 0, 3, 324, 12, 998, 45}
	// inList := []int{2, 7, 4, 3, 0, 1}
	outList := selectSrot(inList)
}
